<!-- $Id: rg_coupons_list.htm 14216 2008-03-10 02:27:21Z testyang $ -->

{if $full_page}
{include file="pageheader.htm"}
{insert_scripts files="../js/utils.js,listtable.js"}

<div class="form-div">
  <form action="javascript:searchActivity()" name="searchForm">
    <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
    优惠券名称 <input type="text" name="keyword" size="30" />
    <input name="is_going" type="checkbox" id="is_going" value="1" />
    仅显示进行中的活动
    <input type="submit" value="{$lang.button_search}" class="button" />
  </form>
</div>

<form method="post" action="rg_coupons.php" name="listForm" onsubmit="return confirm(batch_drop_confirm);">
<!-- start coupons list -->
<div class="list-div" id="listDiv">
{/if}

  <table cellpadding="3" cellspacing="1">
    <tr>
      <th>
        <input onclick='listTable.selectAll(this, "checkboxes")' type="checkbox" />
        <a href="javascript:listTable.sort('cou_id'); ">编号</a>{$sort_cou_id}</th>
      <th><a href="javascript:listTable.sort('cou_name'); ">优惠券名称</a>{$sort_cou_name}</th>
      <th><a href="javascript:listTable.sort('start_time'); ">开始时间</a>{$sort_start_time}</th>
      <th><a href="javascript:listTable.sort('end_time'); ">结束时间</a>{$sort_end_time}</th>
      <th>券码</th>
      <th>{$lang.handler}</th>
    </tr>
    {foreach from=$coupons_list item=coupons}
    <tr>
      <td align="center"><input value="{$coupons.cou_id}" name="checkboxes[]" type="checkbox">{$coupons.cou_id}</td>
      <td align="center">{$coupons.cou_name|escape:html}</td>
      <td align="center">{$coupons.start_time}</td>
      <td align="center">{$coupons.end_time}</td>
      <td align="center">{$coupons.code_name}</td>
      <td align="center">
        <a href="?act=edit&amp;id={$coupons.cou_id}" title="{$lang.edit}"><img src="images/icon_edit.gif" border="0" height="16" width="16" /></a>
        <a href="javascript:;" onclick="listTable.remove({$coupons.cou_id},'{$lang.drop_confirm}')" title="{$lang.remove}"><img src="images/icon_drop.gif" border="0" height="16" width="16" /></a>	  </td>
    </tr>
    {foreachelse}
    <tr><td class="no-records" colspan="13">{$lang.no_records}</td></tr>
    {/foreach}
  </table>

  <table cellpadding="4" cellspacing="0">
    <tr>
      <td align="right">{include file="page.htm"}</td>
    </tr>
  </table>

{if $full_page}
</div>
<!-- end coupons list -->
</form>

<script type="text/javascript" language="JavaScript">
listTable.recordCount = {$record_count};
listTable.pageCount = {$page_count};

{foreach from=$filter item=item key=key}
listTable.filter.{$key} = '{$item}';
{/foreach}

{literal}
onload = function(){
	document.forms['searchForm'].elements['keyword'].focus();
	startCheckOrder();
}

function searchActivity(){
	var keyword = Utils.trim(document.forms['searchForm'].elements['keyword'].value);
	listTable.filter['keyword'] = keyword;
	if (document.forms['searchForm'].elements['is_going'].checked){
	  listTable.filter['is_going'] = 1;
	}else{
	  listTable.filter['is_going'] = 0;
	}
	listTable.filter['page'] = 1;
	listTable.loadList("coupons_list");
}
{/literal}
</script>

{include file="pagefooter.htm"}
{/if}